package other.nowcoder.easy;

import java.util.Scanner;

/**
 * @author Stark
 * @description 最小公倍数
 * 题目链接:https://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3?
 * tpId=37&&tqId=21331&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 * @date 2022/4/25 23:53
 **/
public class LowestCommonMultiple {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int a = in.nextInt();
            int b = in.nextInt();
            if (a == b)
                System.out.println(a);
            else {
                if (a < b) {
                    int tmp = a;
                    a = b;
                    b = tmp;
                }
                int tmpA = a, tmpB = b,tmp;
                //辗转想减法
//                while((tmp = tmpA - tmpB) != 0){
//                    if(tmp > tmpB){
//                        tmpA = tmp;
//                    }else{
//                        tmpA = tmpB;
//                        tmpB = tmp;
//                    }
//                }
                //辗转相除法
                while((tmp = tmpA % tmpB) != 0){
                    tmpA = tmpB;
                    tmpB = tmp;
                }
//             System.out.println(((a / tmpA) * (b / tmpB)) * tmpB);
            System.out.println(a * b / tmpB);
            }
        }
    }
}
